Imports System.Data.SqlClient

Friend Class DBScanServer
    Inherits DBBase

    Private moServer As SQLAutoDocLib.Server

    Public Sub New(ByVal oServer As SQLAutoDocLib.Server)
        moServer = oServer
    End Sub

    Public Sub ScheduleNewScans()
        Dim oDatabaseFactory As New DBDatabase_Factory

        For Each oDatabase As SQLAutoDocLib.Database In oDatabaseFactory.GetAllDatabasesForServer(moServer.ID)
            Dim lSessionID As Long = SQLAutoDocLib.Session.NODATA
            Dim oScanner As New DBScanDatabase(oDatabase, lSessionID)

            oScanner.CheckAndSchedule(oDatabase, ScanSchedule.Type.SchemaScan, lSessionID)
            oScanner.CheckAndSchedule(oDatabase, ScanSchedule.Type.SizeScan, lSessionID)
            oScanner.CheckAndSchedule(oDatabase, ScanSchedule.Type.BlockScan, lSessionID)
            oScanner.CheckAndSchedule(oDatabase, ScanSchedule.Type.ConnectionScan, lSessionID)
            oScanner.CheckAndSchedule(oDatabase, ScanSchedule.Type.WaitStateScan, lSessionID)
        Next
    End Sub

End Class
